<template>
    <div>
        <input v-model.trim="content" />
        <p>input: {{ content }}</p>
        <p>当前时间: {{ formattedDate }}</p>
    </div>
</template>

<script>
export default {
    data() {
        return {
            price: 200,
            content: "",
            date: new Date(),
        }
    },
    methods: {
        addIcon(val) {
            return '$' + val;
        },
        
    },
    computed:{
        formattedDate() {
            const options = {
                year: 'numeric',
                month: '2-digit',
                day: '2-digit',
                hour: '2-digit',
                minute: '2-digit',
                second: '2-digit',
                hour12: false
            };
            return new Intl.DateTimeFormat('zh-CN', options)
                .format(this.date)
                .replace(/\//g, '-'); // 替换斜杠为横杠
        },
    }
}
</script>

<style></style>